package org.mysocial.datamodel;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author ivan
 * @version 1.0
 * @created 21-Jul-2011 10:00:28 PM
 */
@Entity
@Table(name = "account")
public class Account implements Serializable
{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long id;

	@OneToMany(mappedBy = "fromAccount", fetch = FetchType.LAZY)
	public List<Friendship> friendships;

	@OneToMany(mappedBy = "account", fetch = FetchType.LAZY)
	public Set<Post> posts;

	public Account()
	{

	}

	public List<Friendship> getFriendships()
	{
		return friendships;
	}

	public long getId()
	{
		return id;
	}

	public Set<Post> getPosts()
	{
		return posts;
	}

	public void setFriendships(List<Friendship> friendships)
	{
		this.friendships = friendships;
	}

	public void setId(long id)
	{
		this.id = id;
	}

	public void setPosts(Set<Post> posts)
	{
		this.posts = posts;
	}
}